package com.tsd.system.dao;

import com.tsd.core.vo.PageBean;
import com.tsd.system.entity.SysAccountSetResource;
import com.tsd.system.entity.SysAccountSetResourceExt;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 描述：SysAccountSetResourceMapper
 *
 * @author huawei
 * @date 2022/03/05 11:49:46
 */
public interface SysAccountSetResourceMapper {

    SysAccountSetResource selectByPrimaryKey(Long id);

    SysAccountSetResourceExt selectBySid(String sid);

    int deleteByPrimaryKey(Long id);

    int insert(SysAccountSetResource record);

    int insertSelective(SysAccountSetResource record);

    int insertList(List<SysAccountSetResource> list);

    int updateByPrimaryKey(SysAccountSetResource record);

    int updateByPrimaryKeySelective(SysAccountSetResource record);

    List<SysAccountSetResourceExt> selectByEntity(SysAccountSetResource record);

    List<SysAccountSetResourceExt> selectByPage(@Param("params") Map<String, Object> params, @Param("page") PageBean page);

    List<SysAccountSetResourceExt> selectCount1Page(@Param("params") Map<String, Object> params, @Param("page") PageBean page);

    List<SysAccountSetResourceExt> selectByParams(@Param("params") Map<String, Object> params);

    //批量插入，mysql默认接受sql的大小是1048576(1M)，此方式若数据量超过1M会报如下异常：（可通过调整MySQL安装目录下的my.ini文件中[mysqld]段的＂max_allowed_packet = 1M＂）
    //void insertList(List<SysAccountSetResource> list);
    SysAccountSetResourceExt selectSameByEntity(SysAccountSetResource record);

    /**
     * 为设置提供所有application的列表
     *
     * @param params
     * @return
     */
    List<SysAccountSetResourceExt> selectList4Setting(@Param("params") Map<String, Object> params);
}